package cn.chenbonian.activiti;

import org.activiti.engine.*;
import org.junit.Test;

/**
 * @author chbn
 * @create 2021-10-26
 */

public class Activiti {
    /**
     * 生成 activiti的数据库表
     */
    @Test
    public void testCreateDbTable() {
//        //使用classpath下的activiti.cfg.xml中的配置创建processEngine
//        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
//        System.out.println(processEngine);
        //先构建ProcessEngineConfiguration
        ProcessEngineConfiguration configuration =
                ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
        //通过ProcessEngineConfiguration创建ProcessEngine，此时会创建数据库
        ProcessEngine processEngine = configuration.buildProcessEngine();
        RuntimeService runtimeService = processEngine.getRuntimeService();
        RepositoryService repositoryService = processEngine.getRepositoryService();
        TaskService taskService = processEngine.getTaskService();
        
    }
}
